<?php
/**
 * Created by PhpStorm.
 * User: Huyang
* Date: 2016/9/5
* Time: 16:57
*/

namespace App\Http\Constants;

/**
 * 报错信息业务分段
 * Class BaseExceptionConstant
 * @package App\Http\Constants
 */
class MessageExceptionConstants extends BaseExceptionConstants
{

    public static function code() {
        return $code = [
            'msg_send_too_frequently'=>             ['code'=>'1', 'message'=>'短信发送太频繁，请稍后再试！'],
            'unknown_sms_id'=>                      ['code'=>'2', 'message'=>'未知的短信频道'],
            'msg_save_fail'=>                       ['code'=>'3', 'message'=>'短信保存失败'],
            'msg_find_fail'=>                       ['code'=>'4', 'message'=>'短信查找失败'],
            'msg_was_consume'=>                     ['code'=>'5', 'message'=>'验证码已被使用'],
            'msg_no_code'=>                         ['code'=>'6', 'message'=>'验证码解析失败'],
            'msg_code_match_fail'=>                 ['code'=>'7', 'message'=>'验证码不正确'],
            'msg_num_over'=>                        ['code'=>'8', 'message'=>'短信验证次数已用完'],
        ];
    }

    public static function getKey($key) {

        $top = self::getTopCode('MESSAGE_EXCEPTION_START_CODE');

        $base = self::code()[$key];

        $base['code'] = $top .$base['code'];

        return $base;
    }

}


